package gs.sr.tkfx.util;

import gs.sr.tkfx.param.Req;
import gs.sr.tkfx.param.Resp;

import java.util.Calendar;
import java.util.Date;

public class ReqUtils {
	public static final Req parseReq(Resp resp) {
		Req req = new Req();
		req.setSession(resp.getTop_session());
		Calendar c = Calendar.getInstance();
		Date endCreated = c.getTime();
		// 三个月内的
		c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 90);
		Date startCreated = c.getTime();

		req.setStartCreated(startCreated);
		req.setEndCreated(endCreated);
		return req;
	}
}
